import { request } from '@/http'
import { services } from '@/config'

export function fetchList(query) {
  return request({
    url: `${services.personnelService}rectify/page`,
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: `${services.personnelService}rectify`,
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: `${services.personnelService}rectify/${id}`,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: `${services.personnelService}rectify/${id}`,
    method: 'delete'
  })
}

export function batchRemoveRectifyByIds(ids) {
  return request({
    url: `${services.personnelService}/rectify/batchRemoveRectifyByIds`,
    method: 'delete',
    data: ids
  })
}

export function putObj(obj) {
  return request({
    url: `${services.personnelService}rectify`,
    method: 'put',
    data: obj
  })
}

export function getRegularlyRemind(id) {
  return request({
    url: `${services.personnelService}rectify/getRegularlyRemind/${id}`,
    method: 'get'
  })
}

export function getInforName(id) {
  return request({
    url: `${services.personnelService}rectify/getInforName/${id}`,
    method: 'get'
  })
}

export function addAndRectifyDetailed(obj) {
  return request({
    url: `${services.personnelService}rectify/saveAndRectifyDetailed`,
    method: 'post',
    data: obj
  })
}

export function fetchThoseResponsibleList(query) {
  return request({
    url: `${services.personnelService}rectify/page/thoseResponsible`,
    method: 'get',
    params: query
  })
}

export function getRectifyObj(id) {
  return getObj(id)
}
